管理员界面-商品信息维护页面

<div><button>添加新商品</button></div>
<table>
    <thead>
        <td>id</td>
        <td>名称</td>
        <td>类型</td>
        <td>月销量</td>
        <td>价格</td>
        <td>图片</td>
        <td>操作</td>
    </thead>
    {% for product in product_list %}
    <tr>
        <td><a href="/auth/customer/{{user.uid}}">{{ product.pid }}</a></td>
        <td >{{ product.name }}</td>
        <td> {{ product.type }} </td>
        <td> {{ product.sales }} </td>
        <td> {{ product.price }} </td>
        <td><img src="{{product.imageUrl}}" width="50px"height="50px"></td>
        <td > <button  onclick="delete_product(this)" value="{{product.pid}}">删除</button> </td>
    </tr>
    <script type="text/javascript" src="{{ url_for('static', filename='js/jquery-1.11.1.min_044d0927.js' ) }}"></script>
    <script type="text/javascript" src="{{ url_for('static', filename='js/jquery-1.8.2.min.js')}}"></script>
    <script>
        function delete_product(elem){
            alert("发送POST请求,后台执行delete_product("+elem.value+")")
            $.get("/auth/delete_product/"+elem.value,function(data){
                console.log(data)
                if( data ){
                    alert("已经删除该商品！");
                    location.reload();
                }else{
                    alert("数据库中无法找到该商品！");
                }
             });
        }
    </script>
    {% endfor %}

</table>
